Skip to content

Conversation

elidaks
Copy link
Member

@elidaks elidaks commented Sep 29, 2026

This pr adds:

  • Backend running at 3001
  • Functional API calls
  • Tests
  • Vitest config with thresholds

i decided against using Zod for validation, as I originally thought would be great to have. Zod would make types stricter, and could thus ruin a lot of data because of a small error. Currently we have some leniency on how the data is returned, with some of the fields being "optional". Currently, I think that is the better approach for our application.

If you have some good arguments as to why we should have Zod, don't hesitate to let me know.

Closing: #14

Elida Kjøpstad added 3 commits September 29, 2026 14:00
Sorry for the humongous commit.
With this commit, the server is now possible to run with "npm run server". The Api also returns the amount of games that is requested. However nothing is validated yet.
Some files has been renamed, and showed as empty files instead of being removed.
This adds a trycatch in the fillGame to ensure that if there is something that goes wrong, it won't return bad data. The rest seem fine. There might be some issues that are not accounted for yet, but we will fix them when we find them.
@elidaks elidaks requested a review from a team as a code owner September 29, 2026 16:21
@elidaks elidaks linked an issue Sep 29, 2026 that may be closed by this pull request
4 tasks
Copy link
Member

@elinejaa elinejaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good! Ran tests with good coverage. Managed to use the API.

@elinejaa elinejaa merged commit 6615e42 into main Oct 2, 2026
@carmennt carmennt deleted the 14-set-up-the-api-and-backend branch October 2, 2026 08:46
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up the API and backend
2 participants